//
//  ZHDataService.h
//  WDFans
//
//  Created by Zhihong Yuan on 2/7/12.
//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface ZHWebService : NSObject

+ (ZHWebService *)sharedService;

- (void)getPersonalThemes;

//api for news view
- (void)getRecentNewsWithPage:(NSInteger)page 
                 onCompletion:(CompletionBlock)comBlock 
                      onError:(ErrorBlock)errBlock;

//api for personal center view
- (void)getLoginUserInfoWithUsername:(NSString *)name
                            password:(NSString *)pwd
                        onCompletion:(CompletionBlock)comBlock 
                             onError:(ErrorBlock)errBlock;

- (void)getPersonalMessagesWithPage:(NSInteger)page 
                        isReaded:(BOOL)read 
                    onCompletion:(CompletionBlock)comBlock 
                         onError:(ErrorBlock)errBlock;

- (void)setPersonalMessageIsReadWithMesId:(NSInteger)mesId
                             onCompletion:(CompletionBlock)comBlock 
                                  onError:(ErrorBlock)errBlock;

//api for dealer view
- (void)getAllProvincesWithLat:(CGFloat)lat 
                         lon:(CGFloat)lon 
                onCompletion:(CompletionBlock)comBlock 
                     onError:(ErrorBlock)err;

- (void)getAllDealersWithProvinceId:(NSInteger)proId
                                lat:(CGFloat)lat
                                lon:(CGFloat)lon
                       onCompletion:(CompletionBlock)comBlock 
                            onError:(ErrorBlock)errBlock;

//api for forum view
- (void)getForumSectionsOnCompletion:(CompletionBlock)comBlock
                             onError:(ErrorBlock)errBlock;
- (void)getThemesWithSectionId:(NSInteger)sid
                          page:(NSInteger)page
                  onCompletion:(CompletionBlock)comBlock
                       onError:(ErrorBlock)errBlock;

- (void)getThemeDetailsWithSectionId:(NSInteger)sid
                                page:(NSInteger)page
                        onCompletion:(CompletionBlock)comBlock
                             onError:(ErrorBlock)errBlock;

- (void)sendReply:(NSString*)getParm 
                                message:(NSString*)message uploadphoto:(NSData*)uploadphoto 
                        onCompletion:(CompletionBlock)comBlock
                             onError:(ErrorBlock)errBlock;



//api for setting view
- (void)changeUserInfoWithName:(NSString *)name
                        oldPwd:(NSString *)oldPwd
                      province:(NSString *)province
                         email:(NSString *)email
                        newPwd:(NSString *)newPwd
                          city:(NSString *)city
                  onCompletion:(CompletionBlock)comBlock
                       onError:(ErrorBlock)errBlock;

- (void)registerUserWithName:(NSString *)name
                    password:(NSString *)pwd
                       email:(NSString *)email
                    province:(NSString *)province
                        city:(NSString *)city
                onCompletion:(CompletionBlock)comBlock
                     onError:(ErrorBlock)errBlock;



@end
